import {
  post,
  get,
  put,
  dalete,
  postJosn,
  putone,
  patch
} from '../utils/request';


//查询组合商品方案
export function getComgoodslist(data) {
  return post('/api/goods-service/v1/goods/queryGoodsByPage', data);
}


  //查询单位
  export function getProductUnitList(data) {
    return post('/api/goods-service/v1/GoodsUnit/queryGoodsUnit', data);
  }

  //删除图片
export function delGoodsPicture(data) {
      return post('/api/goods-service/v1/goods/delGoodsPicture', data);
  }

   //查询品牌
   export function queryGoodsBrands(data) {
    return post('/api/goods-service/v1/goods/queryGoodsBrands', data);
  }

//查询最小单位商品
export function getGoodsInfoList(data) {
  return get('/api/goods-service/v1/goods/getGoodsInfoList', data);
}

//查询商品详情
export function queryGoodsInfoAll(data) {
  return post('/api/goods-service/v1/goods/queryGoodsInfoAll',data);
  // return post('http://127.0.0.1:18080/api/goods-service/v1/goods/queryGoodsInfoAll', data);
}

   //查询商品分类
   export function queryGoodsCategorys(data) {
     return post('/api/goods-service/v1/goods/getGoodstypeList', data);
  }


//查询门店商品列表
export function queryStockGoods(data) {
  return post('/api/goods-service/v1/goods/queryGoodsInfoList', data);
  // return post('http://127.0.0.1:18080/api/goods-service/v1/goods/queryGoodsInfoList', data);
}

 //新增商品
 export function createGoodsInfo(data) {
   return put('/api/goods-service/v1/goods/addGoodsInfo', data);
  //  return post('http://127.0.0.1:18080/api/goods-service/v1/goods/addGoodsInfo', data);
}
//编辑商品
export function modifyGoodsInfo(data) {
  return post('/api/goods-service/v1/goods/updateGoodsInfo', data);
  // return post('http://127.0.0.1:18080/api/goods-service/v1/goods/updateGoodsInfo', data);
}
//删除商品
export function deleteGoodsInfo(data) {
  return post('/api/goods-service/v1/goods/deleteGoodsInfo', data);
}

//新增特征组
export function addGoodsGroup(data) {
  return put('/api/goods-service/v1/goods/addGoodsGroup', data);
}

//下拉特征组
export function getGoodsGroupList(data) {
  return post('/api/goods-service/v1/goods/getGoodsGroupList', data);
}
//批量新增特征组参数
export function batchaRenewGoodsParam(data) {
  return post('/api/goods-service/v1/goods/batchaRenewGoodsParam', data);
}
//特征组参数值
export function getGoodsParamsList(data) {
  return post('/api/goods-service/v1/goods/getGoodsParamsList?groupId='+data.groupId, data);
}


//打包
export function assemblyCombGoods(data) {
  return post('/api/goods-service/v1/goods/assemblyCombGoods?orgId='+data.orgId+"&goodsId="+data.goodsId+"&count="+data.count, data);
}
//拆包
export function disassemblyCombGoods(data) {
  return post('/api/goods-service/v1/goods/disassemblyCombGoods?orgId='+data.orgId+"&goodsId="+data.goodsId+"&count="+data.count, data);
}


//查询库存
export function getBizStock(data,storeId) {
  return post('/api/trade-service/v1/trade/getBizStock?storeId='+storeId, data);
}

//检查国际条码 外部系统码是否重复getInfoMax
export function checkCode(data) {
  return post("/api/goods-service/v1/goods/checkCode", data);
}
//检查排序的最大值
export function getInfoMax() {
         return post("/api/goods-service/v1/goods/getInfoMax");
       }
